package cn.gd.service.TravelApplicationsService;

import cn.gd.mapper.TravelApplicationsMapper.TravelApplicationsMapper;
import cn.gd.pojo.Travelapplications;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TravelApplicationsServiceImpl implements TravelApplicationsService {

    private final TravelApplicationsMapper travelApplicationsMapper;

    public TravelApplicationsServiceImpl(TravelApplicationsMapper travelApplicationsMapper) {
        this.travelApplicationsMapper = travelApplicationsMapper;
    }

    @Override
    public List<Travelapplications> findAll() {
        return travelApplicationsMapper.findAll();
    }

    @Override
    public Travelapplications findById(Integer TravelID) {
        return travelApplicationsMapper.findById(TravelID);
    }

    @Override
    public Travelapplications save(Travelapplications travelApplications) {
        travelApplicationsMapper.insert(travelApplications);
        return travelApplications;
    }

    @Override
    public Travelapplications update(Travelapplications travelApplications) {
        travelApplicationsMapper.update(travelApplications);
        return travelApplications;
    }

    @Override
    public void deleteById(Integer TravelID) {
        travelApplicationsMapper.deleteById(TravelID);
    }

    @Override
    public List<Travelapplications> getApprover(Integer travelID) {
        return List.of();
    }
}
